using UnityEngine;
using System.Collections;

public class mainMenuScript : MonoBehaviour {

    GameObject title;
    GameObject playGameButton;
    GameObject authorButton;
    public int titleMarginTop = 90;
    public int titleOriginalWidth = 900;
    public int titleOriginalHeight = 300;

    public int playGameButtonMarginTop = 450;
    public int playGameButtonOriginalWidth = 400;
    public int playGameButtonOriginalHeight = 100;

    public int authorButtonMarginRight = 30;
    public int authorButtonMarginBottom = 0;
    public int authorButtonOriginalWidth = 400;
    public int authorButtonOriginalHeight = 100;

    void Start()
    {
        title = GameObject.Find("title");
        if (title == null)
            throw new System.Exception("title object not found");
        title.transform.position = new Vector3(0, 0, 0);
        playGameButton = GameObject.Find("playGameButton");
        if (playGameButton == null)
            throw new System.Exception("playGameButton object not found");
        playGameButton.transform.position = new Vector3(0, 0, 0);
        authorButton = GameObject.Find("authorButton");
        if (authorButton == null)
            throw new System.Exception("authorButton object not found");
        authorButton.transform.position = new Vector3(0, 0, 0);

    }

    void OnGUI()
    {
        title.guiTexture.pixelInset = new Rect(Screen.width / 2 - titleOriginalWidth / 2, Screen.height - (titleOriginalHeight + titleMarginTop), titleOriginalWidth, titleOriginalHeight);
        playGameButton.guiTexture.pixelInset = new Rect(Screen.width / 2 - playGameButtonOriginalWidth / 2, Screen.height - (playGameButtonOriginalHeight + playGameButtonMarginTop), playGameButtonOriginalWidth, playGameButtonOriginalHeight);
        authorButton.guiTexture.pixelInset = new Rect(Screen.width - (authorButtonOriginalWidth + authorButtonMarginRight), authorButtonMarginBottom, authorButtonOriginalWidth, authorButtonOriginalHeight);
    }
}
